import matplotlib.pyplot as plt
import numpy as np

def minus_log(t):
    return -np.log(t)

t = np.arange(0.001,1,0.001)
y1 = minus_log(t)
y2 = minus_log(1-t)
plt.figure(figsize=(6,3))
plt.plot(t,y1,label='-log(h(x))'); plt.plot(t,y2,marker='.',
         label='-log(1-h(x))'); 
plt.xlabel('h(x)'); plt.ylabel('cost') 
plt.legend()
plt.grid(); plt.show()

